home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9643 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: rain.fr!news
  2. From: Fabien Bergeret <fbergeret@nahua.arcanet.fr>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: ** Disabling ctrl-C in C **
  5. Date: Tue, 12 Mar 96 16:25:10 WET
  6. Organization: CSI InterNetNews site
  7. Message-ID: <NEWTNews.826648066.7747.fbergeret@nahua.arcanet.fr>
  8. References: <4hpbv3$6u@maltese.eag.unisysgsg.com>  <fcusack-0803960930130001@mudskipper.cac.psu.edu>
  9. NNTP-Posting-Host: nahua.arcanet.fr
  10. Mime-Version: 1.0
  11. Content-Type: TEXT/PLAIN; charset=US-ASCII
  12. X-Newsreader: NEWTNews & Chameleon -- TCP/IP for MS Windows from NetManage
  13.  
  14.  
  15. > > Was wondering if there was a way in C to dis-allow users to break
  16. > > out of a program when at a prompt.....Tryed to use getche(), getch() and
  17. > > that won't work 'cause I don't have access to conio.h -- By the way, I am
  18. > > on a UNIX machine.  Everything that I have already thought of 
  19. > > pertains to dos. 
  20. > You probably wanted to post this on comp.unix.programmer then.
  21. > see man signal
  22. It's quite easy on a Unix machine. Each process receives a signal ( don't 
  23. remember which one ) when Ctrl-C it hit. All you've got to do is write a 
  24. signal handler for this signal, and to activate it ( with a 
  25. signal(signal_name, signal_handler ) at the beginning of your code.
  26. Hope this helps
  27.  
  28.             Fabien Bergeret
  29.  
  30.